package com.ruiysoft.service.mdse.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruiysoft.entity.mdse.MerchandisePictureSku;
import com.ruiysoft.mapper.mdse.MerchandisePictureSkuMapper;
import com.ruiysoft.service.mdse.IMerchandisePictureSkuService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author liyahui
 * @since 2018-10-27
 */
@Service
public class MerchandisePictureSkuServiceImpl extends ServiceImpl<MerchandisePictureSkuMapper, MerchandisePictureSku> implements IMerchandisePictureSkuService {

    @Override
    public List<MerchandisePictureSku> findSkuPicListBySkuId(Long skuId) {
        return list(new QueryWrapper<MerchandisePictureSku>().eq("sku_id", skuId).eq("del_flag", 0).orderBy(false, false, "sort"));
    }

    @Override
    public MerchandisePictureSku findMdsePicOneBySkuId(Long skuId) {
        return getOne(new QueryWrapper<MerchandisePictureSku>().eq("sku_id", skuId).eq("del_flag", 0).orderBy(false, false, "sort"), false);
    }

}
